/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ihmprojet.view;

import ihmprojet.core.Context;
import ihmprojet.core.Core;
import ihmprojet.core.Events.ActionListener;
import ihmprojet.core.Events.NotificationActionEvent;
import ihmprojet.core.Events.SelectionChangedEvent;
import ihmprojet.core.model.Sommet;
import ihmprojet.core.model.operateur.OperateurUnaire;
import ihmprojet.view.onglets.AjoutContextPanel;
import ihmprojet.view.onglets.FenetreContexte;
import ihmprojet.view.onglets.SuprContextPanel;
import ihmprojet.view.onglets.TypeNotificationEnum;
import ihmprojet.view.onglets.exception.ExceptionPasDeSommetSelectionner;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

/**
 *
 *
 * @author Thomas
 */
public class FenetrePrincipale extends javax.swing.JFrame implements ActionListener {

    public enum TypeEtat {

        ATTENTE, NORMAL;
    }
    private TypeEtat etat = TypeEtat.NORMAL;
    private Core core;
    private int index = 0;
    private Context currentContext;
    private FenetreContexte fenetreContext;
    private MenuHelp menuH;
    private Sommet SommetSelect;
    private ConteneurMinimapPanel miniMapPan;
    private int zoom = 50;
    private TypeNotificationEnum notfifCourante = TypeNotificationEnum.Bienvenue;
    private boolean fenInit = false;
    private Sommet sommetPrecedent;
    private String nomOperateurBinaire = "rien";

    public TypeNotificationEnum getNotfifCourante() {
        return this.notfifCourante;
    }

    public MenuHelp getMenuH() {
        return menuH;
    }

    /**
     * pour signaler chang de situation d'état en vue d'une opé binaire
     */
    private void fireEtatFenetre() {
        if (etat == TypeEtat.ATTENTE) {
            notfifCourante = TypeNotificationEnum.SelectionOP;
            changerLabelNotification(notfifCourante);
            etat = TypeEtat.NORMAL;
            System.out.println("sommet prec:" + sommetPrecedent + " second sommet :" + SommetSelect);
            fenetreContext.addOperateurBinaire(sommetPrecedent, SommetSelect, nomOperateurBinaire);
            changerLabelNotification(TypeNotificationEnum.Binary);
        }
    }

    /**
     * Creates new form fenetrePrincipale
     */
    public FenetrePrincipale(Core core) {
        initComponents();
        this.core = core;
        addNewContext();
        this.miniMapPan = new ConteneurMinimapPanel(currentContext, fenetreContext.getId(), this);
        this.jPanMiniMap.add(miniMapPan);
        this.jPanMiniMap.setLayout(new FlowLayout());
        this.miniMapPan.setVisible(true);
        this.miniMapPan.addMap(currentContext, fenetreContext.getId());
        this.currentContext.addActionListener(this);
        menuH = new MenuHelp(this.jTabbedMenuD, this);
        this.jTabbedMenuD.setSelectedIndex(0);

        //TODO generer un identifiant DONE
        //TODO creer un contexte dans le core DONE
        //TODO creer la vue pour le contexte et l'ajouter dans le tabbedPaneGraph DONE
        this.masquerPropriete();
        fenInit = true;
        Color fond = new Color(51, 51, 51);
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
        //TABEED DESIGN
        UIManager.put("TabbedPane.selected", Color.GRAY);
        UIManager.put("TabbedPane.contentAreaColor", fond);
        UIManager.put("TabbedPane.borderHightlightColor", new Color(80, 50, 50));
        //SLIDER DESIGN
        UIManager.put("Slider.altTrackColor", Color.YELLOW);

        this.getContentPane().setBackground(fond);
        SwingUtilities.updateComponentTreeUI(jTabpaneGraph);
        SwingUtilities.updateComponentTreeUI(jTabOperateur);
        SwingUtilities.updateComponentTreeUI(jTabbedMenuD);
        SwingUtilities.updateComponentTreeUI(jSliderZoom);


        btnUser.setToolTipText("Create an User task");
        btnInteraction.setToolTipText("Create an Interaction task");
        btnApplication.setToolTipText("Create an Application task");
        btnAbstraction.setToolTipText("Create an Abstraction task");
        btnChoice.setToolTipText("One of the two task won't be executed");
        btnConnection.setToolTipText("The task is linked to the others");
        btnDisabling.setToolTipText("The first tasks will disable the second");
        btnOrderIndependance.setToolTipText("The first task don't need the second task to be executed and reverse");
        btnSequentialEnabling.setToolTipText("The first task will have to be executed before the second one");
        btnSuspendResume.setToolTipText("The first task will suspend the second one when it will finished");
        btnSynchronization.setToolTipText("The next tasks will be executed once the two tasks will be finished");
        btnInterleaving.setToolTipText("The first task need the second one to be executed");
        btnOptional.setToolTipText("The task can be not executed to pass to the next task");
        btnIterative.setToolTipText("The task can be done several time");
        btnSequentialEnabingInfo.setToolTipText("The first task will have to be executed before the second one, with information");
        
        
    }

    public void fireChangementFenContexte() {
        this.miniMapPan.fireChangement();
    }

    public Dimension getSizePanContext() {
        return this.jTabpaneGraph.getSize();
    }

    public String getNewId() {
        return "ConcurTaskTree" + ++index;
    }
    private boolean init = false;

    public void addNewContext() {
        if (init) {
            SuprContextPanel sc = (SuprContextPanel) jTabpaneGraph.getComponentAt(jTabpaneGraph.getTabCount() - 1);
            AjoutContextPanel as = (AjoutContextPanel) jTabpaneGraph.getComponentAt(jTabpaneGraph.getTabCount() - 2);
            sc.desactive();
            as.desactive();
            as.remove();
            sc.remove();
        }


        String currentContextId = getNewId();
        core.createContext(currentContextId);
        currentContext = core.getContext(currentContextId);
        fenetreContext = new FenetreContexte(currentContext, currentContextId, this, this.getSizePanContext());
        if (init) {
            miniMapPan.addMap(currentContext, fenetreContext.getId());
        }
        jTabpaneGraph.add(fenetreContext);
        jTabpaneGraph.add("+", new AjoutContextPanel(this, jTabpaneGraph));
        jTabpaneGraph.add("-", new SuprContextPanel(this, jTabpaneGraph));
        //On met le focus du jTab sur le contexte créée
        jTabpaneGraph.setSelectedIndex(jTabpaneGraph.getTabCount() - 1 - 2);
        init = true;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jPopMenuClickDroit = new javax.swing.JPopupMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jpanMenuGauche = new javax.swing.JPanel();
        jPanMGHaut = new javax.swing.JPanel();
        jLabelTaches = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        btnUser = new javax.swing.JButton();
        btnAbstraction = new javax.swing.JButton();
        btnApplication = new javax.swing.JButton();
        btnInteraction = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JSeparator();
        jLabelHelpTasks = new javax.swing.JLabel();
        jPanMGMoyen = new javax.swing.JPanel();
        jSeparatorJPanGM = new javax.swing.JSeparator();
        jLabelOperateurs = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        jTabOperateur = new javax.swing.JTabbedPane();
        jPanMulti = new javax.swing.JPanel();
        lblHigh = new javax.swing.JLabel();
        btnChoice = new javax.swing.JButton();
        btnOrderIndependance = new javax.swing.JButton();
        btnInterleaving = new javax.swing.JButton();
        btnSynchronization = new javax.swing.JButton();
        btnDisabling = new javax.swing.JButton();
        btnSuspendResume = new javax.swing.JButton();
        btnSequentialEnabling = new javax.swing.JButton();
        btnSequentialEnabingInfo = new javax.swing.JButton();
        lblLow = new javax.swing.JLabel();
        jPanMono = new javax.swing.JPanel();
        jPanMonoInterne = new javax.swing.JPanel();
        btnIterative = new javax.swing.JButton();
        btnOptional = new javax.swing.JButton();
        btnConnection = new javax.swing.JButton();
        jPanTreeOperation = new javax.swing.JPanel();
        lblTreeOperation = new javax.swing.JLabel();
        jLabelHelpTreeOperation = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jSlider1 = new javax.swing.JSlider();
        jLabel2 = new javax.swing.JLabel();
        jSlider2 = new javax.swing.JSlider();
        jButton1 = new javax.swing.JButton();
        jLabelHelpOperation = new javax.swing.JLabel();
        jPanFooter = new javax.swing.JPanel();
        jPanBlanc = new javax.swing.JPanel();
        jPanZoom = new javax.swing.JPanel();
        jSliderZoom = new javax.swing.JSlider();
        jPanLabelNotif = new javax.swing.JPanel();
        labelNotification = new javax.swing.JLabel();
        jPanDroit = new javax.swing.JPanel();
        jPanMiniMap = new javax.swing.JPanel();
        jTabbedMenuD = new javax.swing.JTabbedPane();
        jPanEdit = new javax.swing.JPanel();
        lblId = new javax.swing.JLabel();
        jTextFieldIdentifier = new javax.swing.JTextField();
        lblName = new javax.swing.JLabel();
        jTextFieldname = new javax.swing.JTextField();
        lblCategory = new javax.swing.JLabel();
        cbxCat = new javax.swing.JComboBox();
        lblDescription = new javax.swing.JLabel();
        jScrollPanDescription = new javax.swing.JScrollPane();
        txtAreaDescription = new javax.swing.JTextArea();
        btnUpdateProperties1 = new javax.swing.JButton();
        btnUpdateProperties2 = new javax.swing.JButton();
        lblProperties = new javax.swing.JLabel();
        jTabpaneGraph = new javax.swing.JTabbedPane();
        jMenuBar = new javax.swing.JMenuBar();
        jMenuFile = new javax.swing.JMenu();
        jMenuFileNew = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        jMenuFileOpen = new javax.swing.JMenuItem();
        jSeparator4 = new javax.swing.JPopupMenu.Separator();
        jMenuFileSave = new javax.swing.JMenuItem();
        jMenuEdit = new javax.swing.JMenu();
        jMenuEditUndo = new javax.swing.JMenuItem();
        jMenuEditRedo = new javax.swing.JMenuItem();
        jSeparator5 = new javax.swing.JPopupMenu.Separator();
        jMenuEditCopy = new javax.swing.JMenuItem();
        jMenuEditPaste = new javax.swing.JMenuItem();
        jMenuHelp = new javax.swing.JMenu();
        jMenuHelpManual = new javax.swing.JMenuItem();
        jMenuGlobal = new javax.swing.JMenuItem();

        jPopMenuClickDroit.setToolTipText("zqsedrtfh");
        jPopMenuClickDroit.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jPopMenuClickDroitMouseExited(evt);
            }
        });

        jMenuItem1.setText("jMenuItem1");
        jPopMenuClickDroit.add(jMenuItem1);

        jMenuItem4.setText("jMenuItem4");
        jPopMenuClickDroit.add(jMenuItem4);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("TaskPro");
        setBackground(new java.awt.Color(51, 51, 51));
        setMinimumSize(new java.awt.Dimension(500, 500));
        setPreferredSize(new java.awt.Dimension(950, 740));
        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                formMousePressed(evt);
            }
        });
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                formComponentResized(evt);
            }
        });

        jpanMenuGauche.setBackground(new java.awt.Color(51, 51, 51));
        jpanMenuGauche.setMinimumSize(new java.awt.Dimension(150, 500));
        jpanMenuGauche.setPreferredSize(new java.awt.Dimension(150, 500));
        java.awt.GridBagLayout jpanMenuGaucheLayout = new java.awt.GridBagLayout();
        jpanMenuGaucheLayout.columnWidths = new int[] {1};
        jpanMenuGaucheLayout.rowHeights = new int[] {2};
        jpanMenuGauche.setLayout(jpanMenuGaucheLayout);

        jPanMGHaut.setBackground(new java.awt.Color(51, 51, 51));
        jPanMGHaut.setMinimumSize(new java.awt.Dimension(150, 190));
        jPanMGHaut.setPreferredSize(new java.awt.Dimension(150, 190));

        jLabelTaches.setForeground(new java.awt.Color(204, 204, 204));
        jLabelTaches.setText("Tasks");
        jLabelTaches.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);

        jPanel1.setLayout(new java.awt.GridLayout(4, 1));

        btnUser.setBackground(java.awt.Color.lightGray);
        btnUser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/tasks/utilisateur.gif"))); // NOI18N
        btnUser.setToolTipText("");
        btnUser.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "User", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnUser.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnUser.setIconTextGap(10);
        btnUser.setMaximumSize(new java.awt.Dimension(44, 44));
        btnUser.setMinimumSize(new java.awt.Dimension(44, 44));
        btnUser.setPreferredSize(new java.awt.Dimension(100, 44));
        btnUser.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btnUserMouseEntered(evt);
            }
        });
        btnUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUserActionPerformed(evt);
            }
        });
        jPanel1.add(btnUser);

        btnAbstraction.setBackground(java.awt.Color.lightGray);
        btnAbstraction.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/tasks/abstraction.gif"))); // NOI18N
        btnAbstraction.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Abstraction", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnAbstraction.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnAbstraction.setMaximumSize(new java.awt.Dimension(44, 44));
        btnAbstraction.setMinimumSize(new java.awt.Dimension(44, 44));
        btnAbstraction.setPreferredSize(new java.awt.Dimension(100, 44));
        btnAbstraction.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAbstractionActionPerformed(evt);
            }
        });
        jPanel1.add(btnAbstraction);

        btnApplication.setBackground(java.awt.Color.lightGray);
        btnApplication.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/tasks/application.gif"))); // NOI18N
        btnApplication.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Application", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnApplication.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnApplication.setMaximumSize(new java.awt.Dimension(44, 44));
        btnApplication.setMinimumSize(new java.awt.Dimension(44, 44));
        btnApplication.setPreferredSize(new java.awt.Dimension(100, 44));
        btnApplication.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnApplicationActionPerformed(evt);
            }
        });
        jPanel1.add(btnApplication);

        btnInteraction.setBackground(java.awt.Color.lightGray);
        btnInteraction.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/tasks/interaction.gif"))); // NOI18N
        btnInteraction.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Interaction", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnInteraction.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnInteraction.setMaximumSize(new java.awt.Dimension(44, 44));
        btnInteraction.setMinimumSize(new java.awt.Dimension(44, 44));
        btnInteraction.setPreferredSize(new java.awt.Dimension(100, 44));
        btnInteraction.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInteractionActionPerformed(evt);
            }
        });
        jPanel1.add(btnInteraction);

        jLabelHelpTasks.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/pointInterro.png"))); // NOI18N
        jLabelHelpTasks.setToolTipText("Add a tasks to your model");

        javax.swing.GroupLayout jPanMGHautLayout = new javax.swing.GroupLayout(jPanMGHaut);
        jPanMGHaut.setLayout(jPanMGHautLayout);
        jPanMGHautLayout.setHorizontalGroup(
            jPanMGHautLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator3)
            .addGroup(jPanMGHautLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(jPanMGHautLayout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addComponent(jLabelTaches)
                .addGap(14, 14, 14)
                .addComponent(jLabelHelpTasks)
                .addContainerGap())
        );
        jPanMGHautLayout.setVerticalGroup(
            jPanMGHautLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanMGHautLayout.createSequentialGroup()
                .addGroup(jPanMGHautLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanMGHautLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelTaches)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanMGHautLayout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabelHelpTasks)
                        .addGap(10, 10, 10)))
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jpanMenuGauche.add(jPanMGHaut, new java.awt.GridBagConstraints());

        jPanMGMoyen.setBackground(new java.awt.Color(51, 51, 51));
        jPanMGMoyen.setToolTipText("");
        jPanMGMoyen.setMinimumSize(new java.awt.Dimension(150, 300));
        jPanMGMoyen.setPreferredSize(new java.awt.Dimension(150, 300));

        jLabelOperateurs.setBackground(new java.awt.Color(51, 51, 51));
        jLabelOperateurs.setForeground(new java.awt.Color(204, 204, 204));
        jLabelOperateurs.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelOperateurs.setText("Operators");

        jTabOperateur.setBackground(new java.awt.Color(51, 51, 51));
        jTabOperateur.setForeground(new java.awt.Color(255, 255, 255));

        jPanMulti.setBackground(new java.awt.Color(51, 51, 51));
        jPanMulti.setLayout(new java.awt.GridLayout(10, 1));

        lblHigh.setBackground(new java.awt.Color(51, 51, 51));
        lblHigh.setFont(new java.awt.Font("Ubuntu", 0, 12)); // NOI18N
        lblHigh.setForeground(new java.awt.Color(204, 204, 204));
        lblHigh.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblHigh.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/arrowup.gif"))); // NOI18N
        lblHigh.setText("High prioirity");
        jPanMulti.add(lblHigh);

        btnChoice.setBackground(java.awt.Color.lightGray);
        btnChoice.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnChoice.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/choice.gif"))); // NOI18N
        btnChoice.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Choice", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnChoice.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnChoice.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnChoiceActionPerformed(evt);
            }
        });
        jPanMulti.add(btnChoice);

        btnOrderIndependance.setBackground(java.awt.Color.lightGray);
        btnOrderIndependance.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/order.gif"))); // NOI18N
        btnOrderIndependance.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "OrderIndependance", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnOrderIndependance.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnOrderIndependance.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnOrderIndependanceActionPerformed(evt);
            }
        });
        jPanMulti.add(btnOrderIndependance);

        btnInterleaving.setBackground(java.awt.Color.lightGray);
        btnInterleaving.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/interleave.gif"))); // NOI18N
        btnInterleaving.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Interleaving", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnInterleaving.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnInterleaving.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInterleavingActionPerformed(evt);
            }
        });
        jPanMulti.add(btnInterleaving);

        btnSynchronization.setBackground(java.awt.Color.lightGray);
        btnSynchronization.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/sincro.gif"))); // NOI18N
        btnSynchronization.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Synchronization", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnSynchronization.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnSynchronization.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSynchronizationActionPerformed(evt);
            }
        });
        jPanMulti.add(btnSynchronization);

        btnDisabling.setBackground(java.awt.Color.lightGray);
        btnDisabling.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/disabling.gif"))); // NOI18N
        btnDisabling.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Disabling", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnDisabling.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnDisabling.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDisablingActionPerformed(evt);
            }
        });
        jPanMulti.add(btnDisabling);

        btnSuspendResume.setBackground(java.awt.Color.lightGray);
        btnSuspendResume.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/suspend.gif"))); // NOI18N
        btnSuspendResume.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SuspendResume", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnSuspendResume.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnSuspendResume.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSuspendResumeActionPerformed(evt);
            }
        });
        jPanMulti.add(btnSuspendResume);

        btnSequentialEnabling.setBackground(java.awt.Color.lightGray);
        btnSequentialEnabling.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/enabling.gif"))); // NOI18N
        btnSequentialEnabling.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SequentialEnabling", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnSequentialEnabling.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnSequentialEnabling.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSequentialEnablingActionPerformed(evt);
            }
        });
        jPanMulti.add(btnSequentialEnabling);

        btnSequentialEnabingInfo.setBackground(java.awt.Color.lightGray);
        btnSequentialEnabingInfo.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnSequentialEnabingInfo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/enablinginfo.gif"))); // NOI18N
        btnSequentialEnabingInfo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SequentialEnablingInfo", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnSequentialEnabingInfo.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnSequentialEnabingInfo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSequentialEnabingInfoActionPerformed(evt);
            }
        });
        jPanMulti.add(btnSequentialEnabingInfo);

        lblLow.setFont(new java.awt.Font("Ubuntu", 0, 12)); // NOI18N
        lblLow.setForeground(new java.awt.Color(204, 204, 204));
        lblLow.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblLow.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/arrowdown.gif"))); // NOI18N
        lblLow.setText("Low priority");
        jPanMulti.add(lblLow);

        jTabOperateur.addTab("Mutli", jPanMulti);

        jPanMono.setBackground(new java.awt.Color(51, 51, 51));

        jPanMonoInterne.setLayout(new java.awt.GridLayout(3, 1));

        btnIterative.setBackground(java.awt.Color.lightGray);
        btnIterative.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/iterative.gif"))); // NOI18N
        btnIterative.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Set/Unset Iterative", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnIterative.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnIterative.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIterativeActionPerformed(evt);
            }
        });
        jPanMonoInterne.add(btnIterative);

        btnOptional.setBackground(java.awt.Color.lightGray);
        btnOptional.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/optional.gif"))); // NOI18N
        btnOptional.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Set/Unset Optional", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnOptional.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnOptional.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnOptionalActionPerformed(evt);
            }
        });
        jPanMonoInterne.add(btnOptional);

        btnConnection.setBackground(java.awt.Color.lightGray);
        btnConnection.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/operateurs/arrowico.gif"))); // NOI18N
        btnConnection.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Set/Unset Connection", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 10))); // NOI18N
        btnConnection.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnConnection.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConnectionActionPerformed(evt);
            }
        });
        jPanMonoInterne.add(btnConnection);

        javax.swing.GroupLayout jPanMonoLayout = new javax.swing.GroupLayout(jPanMono);
        jPanMono.setLayout(jPanMonoLayout);
        jPanMonoLayout.setHorizontalGroup(
            jPanMonoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanMonoInterne, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
        );
        jPanMonoLayout.setVerticalGroup(
            jPanMonoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanMonoLayout.createSequentialGroup()
                .addComponent(jPanMonoInterne, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 185, Short.MAX_VALUE))
        );

        jTabOperateur.addTab("Mono", jPanMono);

        jPanTreeOperation.setBackground(new java.awt.Color(51, 51, 51));
        jPanTreeOperation.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 2));

        lblTreeOperation.setForeground(new java.awt.Color(204, 204, 204));
        lblTreeOperation.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblTreeOperation.setText("Tree Operations");
        jPanTreeOperation.add(lblTreeOperation);

        jLabelHelpTreeOperation.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/pointInterro.png"))); // NOI18N
        jLabelHelpTreeOperation.setToolTipText("Make operation on the structure of your tree");
        jPanTreeOperation.add(jLabelHelpTreeOperation);

        jLabel1.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Change high");
        jPanTreeOperation.add(jLabel1);

        jSlider1.setBackground(new java.awt.Color(51, 51, 51));
        jSlider1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSlider1StateChanged(evt);
            }
        });
        jPanTreeOperation.add(jSlider1);

        jLabel2.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Change width");
        jPanTreeOperation.add(jLabel2);

        jSlider2.setBackground(new java.awt.Color(51, 51, 51));
        jSlider2.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSlider2StateChanged(evt);
            }
        });
        jPanTreeOperation.add(jSlider2);

        jButton1.setBackground(new java.awt.Color(204, 204, 204));
        jButton1.setText("Restore default");
        jButton1.setToolTipText("Restore default high and width of graph.");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanTreeOperation.add(jButton1);

        jLabelHelpOperation.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/pointInterro.png"))); // NOI18N
        jLabelHelpOperation.setToolTipText("Add multi operator between two tasks or mono operator on one task\n");

        javax.swing.GroupLayout jPanMGMoyenLayout = new javax.swing.GroupLayout(jPanMGMoyen);
        jPanMGMoyen.setLayout(jPanMGMoyenLayout);
        jPanMGMoyenLayout.setHorizontalGroup(
            jPanMGMoyenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanMGMoyenLayout.createSequentialGroup()
                .addGroup(jPanMGMoyenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanMGMoyenLayout.createSequentialGroup()
                        .addComponent(jPanTreeOperation, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jTabOperateur, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(jSeparator2))
            .addGroup(jPanMGMoyenLayout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jLabelOperateurs, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addComponent(jLabelHelpOperation)
                .addGap(43, 43, 43)
                .addComponent(jSeparatorJPanGM))
        );
        jPanMGMoyenLayout.setVerticalGroup(
            jPanMGMoyenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanMGMoyenLayout.createSequentialGroup()
                .addGroup(jPanMGMoyenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanMGMoyenLayout.createSequentialGroup()
                        .addGroup(jPanMGMoyenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanMGMoyenLayout.createSequentialGroup()
                                .addComponent(jSeparatorJPanGM, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jLabelOperateurs))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(jPanMGMoyenLayout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabelHelpOperation)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGroup(jPanMGMoyenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTabOperateur, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanTreeOperation, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.weighty = 0.3;
        jpanMenuGauche.add(jPanMGMoyen, gridBagConstraints);

        getContentPane().add(jpanMenuGauche, java.awt.BorderLayout.LINE_START);

        jPanFooter.setBackground(new java.awt.Color(51, 102, 0));
        jPanFooter.setForeground(new java.awt.Color(255, 102, 0));
        jPanFooter.setPreferredSize(new java.awt.Dimension(745, 40));
        jPanFooter.setLayout(new java.awt.BorderLayout());

        jPanBlanc.setBackground(new java.awt.Color(51, 51, 51));
        jPanBlanc.setPreferredSize(new java.awt.Dimension(150, 40));

        javax.swing.GroupLayout jPanBlancLayout = new javax.swing.GroupLayout(jPanBlanc);
        jPanBlanc.setLayout(jPanBlancLayout);
        jPanBlancLayout.setHorizontalGroup(
            jPanBlancLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 150, Short.MAX_VALUE)
        );
        jPanBlancLayout.setVerticalGroup(
            jPanBlancLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 40, Short.MAX_VALUE)
        );

        jPanFooter.add(jPanBlanc, java.awt.BorderLayout.WEST);

        jPanZoom.setBackground(new java.awt.Color(51, 51, 51));
        jPanZoom.setPreferredSize(new java.awt.Dimension(165, 40));

        jSliderZoom.setBackground(new java.awt.Color(51, 51, 51));
        jSliderZoom.setForeground(new java.awt.Color(255, 255, 255));
        jSliderZoom.setMaximum(55);
        jSliderZoom.setMinimum(45);
        jSliderZoom.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jSliderZoom.setPreferredSize(new java.awt.Dimension(150, 26));
        jSliderZoom.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderZoomStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jPanZoomLayout = new javax.swing.GroupLayout(jPanZoom);
        jPanZoom.setLayout(jPanZoomLayout);
        jPanZoomLayout.setHorizontalGroup(
            jPanZoomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanZoomLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jSliderZoom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanZoomLayout.setVerticalGroup(
            jPanZoomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanZoomLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jSliderZoom, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanFooter.add(jPanZoom, java.awt.BorderLayout.EAST);

        jPanLabelNotif.setBackground(new java.awt.Color(51, 51, 51));
        jPanLabelNotif.setForeground(new java.awt.Color(255, 255, 255));
        jPanLabelNotif.setPreferredSize(new java.awt.Dimension(850, 30));

        labelNotification.setBackground(new java.awt.Color(51, 51, 51));
        labelNotification.setForeground(new java.awt.Color(204, 204, 204));
        labelNotification.setText("Welcome !");

        javax.swing.GroupLayout jPanLabelNotifLayout = new javax.swing.GroupLayout(jPanLabelNotif);
        jPanLabelNotif.setLayout(jPanLabelNotifLayout);
        jPanLabelNotifLayout.setHorizontalGroup(
            jPanLabelNotifLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanLabelNotifLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelNotification, javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanLabelNotifLayout.setVerticalGroup(
            jPanLabelNotifLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(labelNotification, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
        );

        jPanFooter.add(jPanLabelNotif, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPanFooter, java.awt.BorderLayout.PAGE_END);

        jPanDroit.setBackground(new java.awt.Color(51, 51, 51));
        jPanDroit.setPreferredSize(new java.awt.Dimension(170, 469));

        jPanMiniMap.setBackground(new java.awt.Color(51, 51, 51));
        jPanMiniMap.setMaximumSize(new java.awt.Dimension(200, 200));

        javax.swing.GroupLayout jPanMiniMapLayout = new javax.swing.GroupLayout(jPanMiniMap);
        jPanMiniMap.setLayout(jPanMiniMapLayout);
        jPanMiniMapLayout.setHorizontalGroup(
            jPanMiniMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 170, Short.MAX_VALUE)
        );
        jPanMiniMapLayout.setVerticalGroup(
            jPanMiniMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 121, Short.MAX_VALUE)
        );

        jTabbedMenuD.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jTabbedMenuDMousePressed(evt);
            }
        });

        jPanEdit.setBackground(new java.awt.Color(51, 51, 51));
        jPanEdit.setPreferredSize(new java.awt.Dimension(165, 275));

        lblId.setForeground(new java.awt.Color(204, 204, 204));
        lblId.setText("Identifier :");

        jTextFieldIdentifier.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                jTextFieldIdentifierMouseMoved(evt);
            }
        });

        lblName.setForeground(new java.awt.Color(204, 204, 204));
        lblName.setText("Name :");

        lblCategory.setForeground(new java.awt.Color(204, 204, 204));
        lblCategory.setText("Category :");

        cbxCat.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "User", "Abstraction", "Appllication", "Interaction" }));

        lblDescription.setForeground(new java.awt.Color(204, 204, 204));
        lblDescription.setText("Description :");

        txtAreaDescription.setColumns(15);
        txtAreaDescription.setFont(new java.awt.Font("Dialog", 0, 9)); // NOI18N
        txtAreaDescription.setRows(5);
        jScrollPanDescription.setViewportView(txtAreaDescription);

        btnUpdateProperties1.setBackground(java.awt.Color.lightGray);
        btnUpdateProperties1.setText("Clear");
        btnUpdateProperties1.setToolTipText("Clean the properties selection");
        btnUpdateProperties1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUpdateProperties1ActionPerformed(evt);
            }
        });

        btnUpdateProperties2.setBackground(java.awt.Color.lightGray);
        btnUpdateProperties2.setText("Update");
        btnUpdateProperties2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUpdateProperties2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanEditLayout = new javax.swing.GroupLayout(jPanEdit);
        jPanEdit.setLayout(jPanEditLayout);
        jPanEditLayout.setHorizontalGroup(
            jPanEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanEditLayout.createSequentialGroup()
                .addGroup(jPanEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanEditLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldIdentifier)
                            .addComponent(jTextFieldname)
                            .addGroup(jPanEditLayout.createSequentialGroup()
                                .addGroup(jPanEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblId)
                                    .addComponent(lblName)
                                    .addComponent(lblCategory)
                                    .addComponent(cbxCat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblDescription))
                                .addGap(0, 20, Short.MAX_VALUE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanEditLayout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(jPanEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(btnUpdateProperties2, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                            .addComponent(btnUpdateProperties1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
            .addComponent(jScrollPanDescription, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
        );
        jPanEditLayout.setVerticalGroup(
            jPanEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanEditLayout.createSequentialGroup()
                .addComponent(lblId)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldIdentifier, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblName, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblCategory)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cbxCat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblDescription)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPanDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnUpdateProperties2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnUpdateProperties1)
                .addContainerGap(16, Short.MAX_VALUE))
        );

        jTabbedMenuD.addTab("General", jPanEdit);

        lblProperties.setForeground(new java.awt.Color(204, 204, 204));
        lblProperties.setText("Properties");

        javax.swing.GroupLayout jPanDroitLayout = new javax.swing.GroupLayout(jPanDroit);
        jPanDroit.setLayout(jPanDroitLayout);
        jPanDroitLayout.setHorizontalGroup(
            jPanDroitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanMiniMap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jTabbedMenuD, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanDroitLayout.createSequentialGroup()
                .addContainerGap(53, Short.MAX_VALUE)
                .addComponent(lblProperties)
                .addGap(44, 44, 44))
        );
        jPanDroitLayout.setVerticalGroup(
            jPanDroitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanDroitLayout.createSequentialGroup()
                .addComponent(jPanMiniMap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addComponent(lblProperties)
                .addGap(18, 18, 18)
                .addComponent(jTabbedMenuD, javax.swing.GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE))
        );

        getContentPane().add(jPanDroit, java.awt.BorderLayout.LINE_END);

        jTabpaneGraph.setBackground(new java.awt.Color(102, 102, 102));
        jTabpaneGraph.setForeground(new java.awt.Color(255, 255, 255));
        jTabpaneGraph.setMinimumSize(new java.awt.Dimension(200, 200));
        jTabpaneGraph.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabpaneGraphStateChanged(evt);
            }
        });
        getContentPane().add(jTabpaneGraph, java.awt.BorderLayout.CENTER);

        jMenuBar.setBackground(new java.awt.Color(51, 51, 51));
        jMenuBar.setBorder(null);

        jMenuFile.setForeground(new java.awt.Color(255, 255, 255));
        jMenuFile.setText("File");

        jMenuFileNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        jMenuFileNew.setText("New");
        jMenuFileNew.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuFileNewActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuFileNew);
        jMenuFile.add(jSeparator1);

        jMenuFileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        jMenuFileOpen.setText("Open");
        jMenuFileOpen.setEnabled(false);
        jMenuFile.add(jMenuFileOpen);
        jMenuFile.add(jSeparator4);

        jMenuFileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        jMenuFileSave.setText("Save");
        jMenuFileSave.setEnabled(false);
        jMenuFile.add(jMenuFileSave);

        jMenuBar.add(jMenuFile);

        jMenuEdit.setForeground(new java.awt.Color(255, 255, 255));
        jMenuEdit.setText("Edit");
        jMenuEdit.addMenuListener(new javax.swing.event.MenuListener() {
            public void menuCanceled(javax.swing.event.MenuEvent evt) {
            }
            public void menuDeselected(javax.swing.event.MenuEvent evt) {
            }
            public void menuSelected(javax.swing.event.MenuEvent evt) {
                jMenuEditMenuSelected(evt);
            }
        });

        jMenuEditUndo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_MASK));
        jMenuEditUndo.setText("Undo");
        jMenuEditUndo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuEditUndoActionPerformed(evt);
            }
        });
        jMenuEdit.add(jMenuEditUndo);

        jMenuEditRedo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.CTRL_MASK));
        jMenuEditRedo.setText("Redo");
        jMenuEditRedo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuEditRedoActionPerformed(evt);
            }
        });
        jMenuEdit.add(jMenuEditRedo);
        jMenuEdit.add(jSeparator5);

        jMenuEditCopy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        jMenuEditCopy.setText("Copy");
        jMenuEditCopy.setEnabled(false);
        jMenuEdit.add(jMenuEditCopy);

        jMenuEditPaste.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
        jMenuEditPaste.setText("Paste");
        jMenuEditPaste.setEnabled(false);
        jMenuEdit.add(jMenuEditPaste);

        jMenuBar.add(jMenuEdit);

        jMenuHelp.setForeground(new java.awt.Color(255, 255, 255));
        jMenuHelp.setText("Help");
        jMenuHelp.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuHelpMouseClicked(evt);
            }
        });

        jMenuHelpManual.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK));
        jMenuHelpManual.setText("Manual");
        jMenuHelpManual.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuHelpManualMouseClicked(evt);
            }
        });
        jMenuHelpManual.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuHelpManualActionPerformed(evt);
            }
        });
        jMenuHelp.add(jMenuHelpManual);

        jMenuGlobal.setText("Afficher menu");
        jMenuGlobal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuGlobalActionPerformed(evt);
            }
        });
        jMenuHelp.add(jMenuGlobal);

        jMenuBar.add(jMenuHelp);

        setJMenuBar(jMenuBar);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
    }//GEN-LAST:event_formComponentResized

    private void btnUserMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnUserMouseEntered
////        System.out.println(btnUser.getBorder().toString());
//        System.out.println(btnUser.getComponentCount());
//        for (int i = 1; i < btnUser.getComponentCount(); i++) {
////            if (btnUser.getComponent(i).getClass().equals(javax.swing.border.TitledBorder)) {
////            }
//            System.out.println(btnUser.getComponent(i).getClass());
//            System.out.println("i = " + i + " count = " + btnUser.getComponentCount());
//        }
    }//GEN-LAST:event_btnUserMouseEntered

    private void jPopMenuClickDroitMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPopMenuClickDroitMouseExited
//        jPopMenuClickDroit.setVisible(false);
        boolean visible = false;

        for (Component c : jPopMenuClickDroit.getComponents()) {
            System.out.println("test = ");
            if (evt.getLocationOnScreen() == c.getLocation()) {
                System.out.println("test = ");
            }
            visible = true;

        }
        jPopMenuClickDroit.setVisible(visible);
    }//GEN-LAST:event_jPopMenuClickDroitMouseExited

    private void jMenuFileNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuFileNewActionPerformed
        addNewContext();
    }//GEN-LAST:event_jMenuFileNewActionPerformed

    private void AjouterActionPerformed(java.awt.event.ActionEvent evt, String nom, Sommet.Type type) {
        Component c = jTabpaneGraph.getSelectedComponent();
        if (c instanceof FenetreContexte) {
            ((FenetreContexte) c).addVertex(nom, type);
            c.repaint();
        }
    }
    private void btnUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUserActionPerformed
        AjouterActionPerformed(evt, "Usager", Sommet.Type.UTILISATEUR);
    }//GEN-LAST:event_btnUserActionPerformed

    private void btnAbstractionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAbstractionActionPerformed
        AjouterActionPerformed(evt, "Abstraction", Sommet.Type.ABSTRACTION);
    }//GEN-LAST:event_btnAbstractionActionPerformed

    private void btnApplicationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnApplicationActionPerformed
        AjouterActionPerformed(evt, "Application", Sommet.Type.APPLICATION);
    }//GEN-LAST:event_btnApplicationActionPerformed

    private void btnInteractionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInteractionActionPerformed
        AjouterActionPerformed(evt, "Interaction", Sommet.Type.INTERACTION);
    }//GEN-LAST:event_btnInteractionActionPerformed

    private void btnChoiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChoiceActionPerformed
        sommetPrecedent = SommetSelect;
        etat = TypeEtat.ATTENTE;
        nomOperateurBinaire = "[]";
        notfifCourante = TypeNotificationEnum.SelectionOP;
        changerLabelNotification(notfifCourante);

    }//GEN-LAST:event_btnChoiceActionPerformed

    private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed
    }//GEN-LAST:event_formMousePressed

    private void jTabbedMenuDMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedMenuDMousePressed
    }//GEN-LAST:event_jTabbedMenuDMousePressed

    private void jMenuHelpManualMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuHelpManualMouseClicked
    }//GEN-LAST:event_jMenuHelpManualMouseClicked

    private void jMenuGlobalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuGlobalActionPerformed
        menuH.AfficherMenuGlobal();
        this.changerLabelNotification(TypeNotificationEnum.WelcomeHelp);
    }//GEN-LAST:event_jMenuGlobalActionPerformed

    private void jMenuHelpMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuHelpMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuHelpMouseClicked

    private void jMenuHelpManualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuHelpManualActionPerformed
        this.menuH.afficherDocPDF();
    }//GEN-LAST:event_jMenuHelpManualActionPerformed

    private void jSliderZoomStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderZoomStateChanged
        // zoom
        int difference = zoom - jSliderZoom.getValue();
        if (difference < 0) {
            for (int i = 0; i < -difference; i++) {
                this.fenetreContext.zoomIn();
            }
        } else {
            for (int i = 0; i < difference; i++) {
                this.fenetreContext.zoomOut();
            }
        }
        zoom = jSliderZoom.getValue();
    }//GEN-LAST:event_jSliderZoomStateChanged

    private void btnIterativeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIterativeActionPerformed
        setOpUnaire(OperateurUnaire.TypeUnaire.Iteratif);
    }//GEN-LAST:event_btnIterativeActionPerformed

    private void btnOptionalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOptionalActionPerformed
        setOpUnaire(OperateurUnaire.TypeUnaire.Optionnel);
    }//GEN-LAST:event_btnOptionalActionPerformed

    private void btnConnectionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectionActionPerformed
        setOpUnaire(OperateurUnaire.TypeUnaire.Connection);
    }//GEN-LAST:event_btnConnectionActionPerformed

    private void jTabpaneGraphStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabpaneGraphStateChanged
        if (fenInit) {
            if (!jTabpaneGraph.getTitleAt(jTabpaneGraph.getSelectedIndex()).equals("+")
                    && !jTabpaneGraph.getTitleAt(jTabpaneGraph.getSelectedIndex()).equals("-")) {
                this.fenetreContext = (FenetreContexte) jTabpaneGraph.getComponentAt(jTabpaneGraph.getSelectedIndex());
                this.miniMapPan.stateChanged(fenetreContext.getId());
            }
        }
    }//GEN-LAST:event_jTabpaneGraphStateChanged

    private void jMenuEditUndoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuEditUndoActionPerformed
        this.currentContext.annuler();
    }//GEN-LAST:event_jMenuEditUndoActionPerformed

    private void jMenuEditRedoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuEditRedoActionPerformed
        this.currentContext.refaire();
    }//GEN-LAST:event_jMenuEditRedoActionPerformed

    private void jMenuEditMenuSelected(javax.swing.event.MenuEvent evt) {//GEN-FIRST:event_jMenuEditMenuSelected
        jMenuEditUndo.setEnabled(currentContext.annulable());
        jMenuEditRedo.setEnabled(currentContext.refeasable());
    }//GEN-LAST:event_jMenuEditMenuSelected

    private void btnOrderIndependanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOrderIndependanceActionPerformed
        sommetPrecedent = SommetSelect;
        etat = TypeEtat.ATTENTE;
        notfifCourante = TypeNotificationEnum.SelectionOP;
        changerLabelNotification(notfifCourante);
        nomOperateurBinaire = "|=|";
    }//GEN-LAST:event_btnOrderIndependanceActionPerformed

    private void btnInterleavingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInterleavingActionPerformed
        sommetPrecedent = SommetSelect;
        etat = TypeEtat.ATTENTE;
        notfifCourante = TypeNotificationEnum.SelectionOP;
        changerLabelNotification(notfifCourante);
        nomOperateurBinaire = "|||";
    }//GEN-LAST:event_btnInterleavingActionPerformed

    private void btnSynchronizationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSynchronizationActionPerformed
        sommetPrecedent = SommetSelect;
        etat = TypeEtat.ATTENTE;
        notfifCourante = TypeNotificationEnum.SelectionOP;
        changerLabelNotification(notfifCourante);
        nomOperateurBinaire = "|[]|";
    }//GEN-LAST:event_btnSynchronizationActionPerformed

    private void btnDisablingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDisablingActionPerformed
        sommetPrecedent = SommetSelect;
        etat = TypeEtat.ATTENTE;
        notfifCourante = TypeNotificationEnum.SelectionOP;
        changerLabelNotification(notfifCourante);
        nomOperateurBinaire = "[>";
    }//GEN-LAST:event_btnDisablingActionPerformed

    private void btnSuspendResumeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSuspendResumeActionPerformed
        sommetPrecedent = SommetSelect;
        etat = TypeEtat.ATTENTE;
        notfifCourante = TypeNotificationEnum.SelectionOP;
        changerLabelNotification(notfifCourante);
        nomOperateurBinaire = "|>";
    }//GEN-LAST:event_btnSuspendResumeActionPerformed

    private void btnSequentialEnablingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSequentialEnablingActionPerformed
        sommetPrecedent = SommetSelect;
        etat = TypeEtat.ATTENTE;
        notfifCourante = TypeNotificationEnum.SelectionOP;
        changerLabelNotification(notfifCourante);
        nomOperateurBinaire = ">>";
    }//GEN-LAST:event_btnSequentialEnablingActionPerformed

    private void btnSequentialEnabingInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSequentialEnabingInfoActionPerformed
        sommetPrecedent = SommetSelect;
        etat = TypeEtat.ATTENTE;
        notfifCourante = TypeNotificationEnum.SelectionOP;
        changerLabelNotification(notfifCourante);
        nomOperateurBinaire = "[]>>";
    }//GEN-LAST:event_btnSequentialEnabingInfoActionPerformed
    private int high = 50;
    private int width = 50;
    private void jSlider1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSlider1StateChanged

        int difference = high - jSlider1.getValue();
        if (difference < 0) {
            for (int i = 0; i < -difference; i++) {
                this.fenetreContext.increaseHigh();
            }
        } else {
            for (int i = 0; i < difference; i++) {
                this.fenetreContext.decreaseHigh();
            }
        }
        high = jSlider1.getValue();
    }//GEN-LAST:event_jSlider1StateChanged

    private void jSlider2StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSlider2StateChanged

        int difference = width - jSlider2.getValue();
        if (difference < 0) {
            for (int i = 0; i < -difference; i++) {
                this.fenetreContext.increaseWidth();
            }
        } else {
            for (int i = 0; i < difference; i++) {
                this.fenetreContext.decreaseWidth();
            }
        }
        width = jSlider2.getValue();
    }//GEN-LAST:event_jSlider2StateChanged

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        high = 50;
        width = 50;
        jSlider1.setValue(50);
        jSlider2.setValue(50);
        fenetreContext.restoreDefalutHighWith();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void btnUpdateProperties2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateProperties2ActionPerformed
        if (SommetSelect != null) {
            SommetSelect.setDescription(this.txtAreaDescription.getText());
            if (this.cbxCat.getSelectedIndex() == 0) {
                SommetSelect.setType(Sommet.Type.UTILISATEUR);
            } else if (this.cbxCat.getSelectedIndex() == 1) {
                SommetSelect.setType(Sommet.Type.ABSTRACTION);
            } else if (this.cbxCat.getSelectedIndex() == 2) {
                SommetSelect.setType(Sommet.Type.APPLICATION);
            } else {
                SommetSelect.setType(Sommet.Type.INTERACTION);
            }
            SommetSelect.setNom(this.jTextFieldname.getText());
            this.changerLabelNotification(TypeNotificationEnum.PropertiesActualized);
        } else {
            this.changerLabelNotification(TypeNotificationEnum.VertexActualize);
        }
        fireChangementSelection(new SelectionChangedEvent());
    }//GEN-LAST:event_btnUpdateProperties2ActionPerformed

    private void btnUpdateProperties1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateProperties1ActionPerformed
        // bouton clear
        this.txtAreaDescription.setText("");
        this.jTextFieldIdentifier.setText("");
        this.jTextFieldname.setText("");
        this.jTextFieldname.setText("");
        this.changerLabelNotification(TypeNotificationEnum.Clear);
    }//GEN-LAST:event_btnUpdateProperties1ActionPerformed

    private void jTextFieldIdentifierMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldIdentifierMouseMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldIdentifierMouseMoved

    public void setOpUnaire(OperateurUnaire.TypeUnaire type) {
        Component c = jTabpaneGraph.getSelectedComponent();
        if (c instanceof FenetreContexte) {
            if (SommetSelect == null) {
                menuH.afficherTexteAide(TypeNotificationEnum.UnaryNotSelect);
                notfifCourante = TypeNotificationEnum.UnaryNotSelect;
                this.changerLabelNotification(notfifCourante);
            } else {
                ((FenetreContexte) c).addOperateurUnaire(SommetSelect, type);
                c.repaint();
            }
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FenetrePrincipale.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FenetrePrincipale.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FenetrePrincipale.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FenetrePrincipale.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new FenetrePrincipale(new Core()).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAbstraction;
    private javax.swing.JButton btnApplication;
    private javax.swing.JButton btnChoice;
    private javax.swing.JButton btnConnection;
    private javax.swing.JButton btnDisabling;
    private javax.swing.JButton btnInteraction;
    private javax.swing.JButton btnInterleaving;
    private javax.swing.JButton btnIterative;
    private javax.swing.JButton btnOptional;
    private javax.swing.JButton btnOrderIndependance;
    private javax.swing.JButton btnSequentialEnabingInfo;
    private javax.swing.JButton btnSequentialEnabling;
    private javax.swing.JButton btnSuspendResume;
    private javax.swing.JButton btnSynchronization;
    private javax.swing.JButton btnUpdateProperties1;
    private javax.swing.JButton btnUpdateProperties2;
    private javax.swing.JButton btnUser;
    private javax.swing.JComboBox cbxCat;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabelHelpOperation;
    private javax.swing.JLabel jLabelHelpTasks;
    private javax.swing.JLabel jLabelHelpTreeOperation;
    private javax.swing.JLabel jLabelOperateurs;
    private javax.swing.JLabel jLabelTaches;
    private javax.swing.JMenuBar jMenuBar;
    private javax.swing.JMenu jMenuEdit;
    private javax.swing.JMenuItem jMenuEditCopy;
    private javax.swing.JMenuItem jMenuEditPaste;
    private javax.swing.JMenuItem jMenuEditRedo;
    private javax.swing.JMenuItem jMenuEditUndo;
    private javax.swing.JMenu jMenuFile;
    private javax.swing.JMenuItem jMenuFileNew;
    private javax.swing.JMenuItem jMenuFileOpen;
    private javax.swing.JMenuItem jMenuFileSave;
    private javax.swing.JMenuItem jMenuGlobal;
    private javax.swing.JMenu jMenuHelp;
    private javax.swing.JMenuItem jMenuHelpManual;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JPanel jPanBlanc;
    private javax.swing.JPanel jPanDroit;
    private javax.swing.JPanel jPanEdit;
    private javax.swing.JPanel jPanFooter;
    private javax.swing.JPanel jPanLabelNotif;
    private javax.swing.JPanel jPanMGHaut;
    private javax.swing.JPanel jPanMGMoyen;
    private javax.swing.JPanel jPanMiniMap;
    private javax.swing.JPanel jPanMono;
    private javax.swing.JPanel jPanMonoInterne;
    private javax.swing.JPanel jPanMulti;
    private javax.swing.JPanel jPanTreeOperation;
    private javax.swing.JPanel jPanZoom;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPopupMenu jPopMenuClickDroit;
    private javax.swing.JScrollPane jScrollPanDescription;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JPopupMenu.Separator jSeparator4;
    private javax.swing.JPopupMenu.Separator jSeparator5;
    private javax.swing.JSeparator jSeparatorJPanGM;
    private javax.swing.JSlider jSlider1;
    private javax.swing.JSlider jSlider2;
    private javax.swing.JSlider jSliderZoom;
    private javax.swing.JTabbedPane jTabOperateur;
    private javax.swing.JTabbedPane jTabbedMenuD;
    private javax.swing.JTabbedPane jTabpaneGraph;
    private javax.swing.JTextField jTextFieldIdentifier;
    private javax.swing.JTextField jTextFieldname;
    private javax.swing.JPanel jpanMenuGauche;
    private javax.swing.JLabel labelNotification;
    private javax.swing.JLabel lblCategory;
    private javax.swing.JLabel lblDescription;
    private javax.swing.JLabel lblHigh;
    private javax.swing.JLabel lblId;
    private javax.swing.JLabel lblLow;
    private javax.swing.JLabel lblName;
    private javax.swing.JLabel lblProperties;
    private javax.swing.JLabel lblTreeOperation;
    private javax.swing.JTextArea txtAreaDescription;
    // End of variables declaration//GEN-END:variables

    @Override
    public void fireChangementSelection(SelectionChangedEvent e) {
        if (!e.isSelected()) {
            masquerPropriete();
            SommetSelect = null;  //null si pas de sommet.
        } else {
            try {
                demasquerPropriete();
                SommetSelect = this.fenetreContext.getSelectedVertex();
                this.jTextFieldIdentifier.setText(SommetSelect.getType().name());
                this.jTextFieldname.setText(SommetSelect.getNom());

                if (SommetSelect.getType() == Sommet.Type.UTILISATEUR) {
                    this.cbxCat.setSelectedIndex(0);
                } else if (SommetSelect.getType() == Sommet.Type.ABSTRACTION) {
                    this.cbxCat.setSelectedIndex(1);
                } else if (SommetSelect.getType() == Sommet.Type.APPLICATION) {
                    this.cbxCat.setSelectedIndex(2);
                } else {
                    this.cbxCat.setSelectedIndex(3);
                }
                this.txtAreaDescription.setText(SommetSelect.getDescription());
                fireEtatFenetre();
            } catch (ExceptionPasDeSommetSelectionner ex) {
                SommetSelect = null;  //null si pas de sommet.
                masquerPropriete();
            }
        }
    }

    public void masquerPropriete() {
        this.jTextFieldIdentifier.setEnabled(false);
        this.jTextFieldname.setEnabled(false);
        this.txtAreaDescription.setEnabled(false);
        this.cbxCat.setEnabled(false);
        this.jTextFieldIdentifier.setText("");
        this.jTextFieldname.setText("");
        this.jTextFieldname.setBackground(Color.GRAY);
        this.jTextFieldIdentifier.setBackground(Color.GRAY);
        this.txtAreaDescription.setBackground(Color.GRAY);
        this.txtAreaDescription.setText("");
    }

    public void demasquerPropriete() {
        this.jTextFieldIdentifier.setEnabled(true);
        this.jTextFieldname.setEnabled(true);
        this.txtAreaDescription.setEnabled(true);
        this.cbxCat.setEnabled(true);
        this.jTextFieldname.setBackground(Color.WHITE);
        this.jTextFieldIdentifier.setBackground(Color.WHITE);
        this.txtAreaDescription.setBackground(Color.WHITE);
    }

    public void changerLabelNotification(TypeNotificationEnum er) {
        notfifCourante = er;
        this.labelNotification.setText(er.getLabel());
    }

    @Override
    public void fireNotificationChgmt(NotificationActionEvent nae) {
                if (nae.hasError()){
                    notfifCourante=nae.getErreur();
                    changerLabelNotification(nae.getErreur());
                    menuH.afficherTexteAide(notfifCourante);
                }
        this.labelNotification.setText(nae.getCh());
        this.fenetreContext.fireChangement();
    }

    void suprimerBoutonPlus() {
        this.jTabpaneGraph.remove(jTabpaneGraph.getTabCount() - 1);

    }
//    void removeContext() {
//        throw new UnsupportedOperationException("Not yet implemented");
//    }
}
